import Vue from 'vue';
import Vuex from 'vuex'; 
import pause from './pause/index.js';
import music from './music/index.js';
import matrix from './matrix/index.js';
import next from './next/index.js';
import cur from './cur/index.js';
import startLines from './startLines/index.js';
import max from './max/index.js';
import points from './points/index.js';
import speedStart from './speedStart/index.js';
import speedRun from './speedRun/index.js';
import lock from './lock/index.js';
import clearLines from './clearLines/index.js';
import reset from './reset/index.js';
import drop from './drop/index.js';
import keyboard from './keyboard/index.js';
import focus from './focus/index.js';
import buttons from './buttons/index.js';


Vue.use(Vuex);

//这里的store没有分模块，之前原作者处理的不好
//keyboard可能是后面新加的，所以分了
export default new Vuex.Store({
	state: {
		pause: pause.state,
		music: music.state,
		matrix: matrix.state,
		next: next.state,
		cur: cur.state,
		startLines: startLines.state,
		max: max.state,
		points: points.state,
		speedStart: speedStart.state,
		speedRun: speedRun.state,
		lock: lock.state,
		clearLines: clearLines.state,
		reset: reset.state,
		drop: drop.state,
		focus: focus.state,
		buttons: buttons.state, //按键
		help: !false, // 开启辅助线对齐
	},
	mutations: {
		pause: pause.pause,
		music: music.music,
		matrix: matrix.matrix,
		next: next.next,
		moveBlock: cur.moveBlock,
		startLines: startLines.startLines,
		max: max.max,
		points: points.points,
		speedStart: speedStart.speedStart,
		speedRun: speedRun.speedRun,
		lock: lock.lock,
		clearLines: clearLines.clearLines,
		reset: reset.reset,
		drop: drop.drop,
		focus: focus.focus,
		buttons: buttons.buttons,
		help(state, v) {
			return state.help = v;
		}
	},
	actions: {},
	modules: {
		keyboard
	}
});